package cc.mrbird.febs.order.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wuwenze.poi.annotation.Excel;
import com.wuwenze.poi.annotation.ExcelField;

import cc.mrbird.febs.common.converter.TimeConverter;
import lombok.Data;

/**
 * 订单表 Entity
 *
 * @author Lord
 * @date 2020-06-06 17:00:35
 */
@Data
@TableName("t_order_info")
@Excel("订单信息表")
public class OrderInfo implements Serializable {

    private static final long serialVersionUID = 7991468825074868581L;

    /**
     * 订单 ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 会员 ID
     */
    @TableField("member_id")
    private Long memberId;

    /**
     * 订单编号
     */
    @TableField("order_sn")
    @ExcelField(value = "订单编号")
    private String orderSn;

    /**
     * 交易流水号
     */
    @TableField("trade_sn")
    @ExcelField(value = "交易流水号")
    private String tradeSn;

    /**
     * 提交时间
     */
    @TableField("create_time")
    @ExcelField(value = "提交时间", writeConverter = TimeConverter.class)
    private Date createTime;

    /**
     * 用户手机号
     */
    @TableField("member_phone")
    @ExcelField(value = "用户手机号")
    private String memberPhone;

    /**
     * 订单总金额
     */
    @TableField("total_amount")
    @ExcelField(value = "订单总金额")
    private BigDecimal totalAmount;

    /**
     * 应付金额（实际支付金额）
     */
    @TableField("pay_amount")
    @ExcelField(value = "应付金额（实际支付金额）")
    private BigDecimal payAmount;

    /**
     * 促销优化金额（促销价、满减、阶梯价）
     */
    @TableField("promotion_amount")
    private BigDecimal promotionAmount;

    /**
     * 管理员后台调整订单使用的折扣金额
     */
    @TableField("discount_amount")
    private BigDecimal discountAmount;

    /**
     * 支付方式：0->未支付；1->支付宝；2->微信；3->银联
     */
    @TableField("pay_type")
    @ExcelField(value = "支付方式", writeConverterExp = "0=未支付,1=支付宝,2=微信,3=银联")
    private Integer payType;

    /**
     * 订单来源：0->PC订单；1->app订单
     */
    @TableField("source_type")
    private Integer sourceType;

    /**
     * 订单状态：0->待付款；1->待发货；2->已发货；3->已完成；4->已关闭；5->无效订单
     */
    @TableField("status")
    @ExcelField(value = "订单状态", writeConverterExp = "0=待付款,1=待发货,2=已发货,3=已完成,4=已关闭,5=无效订单")
    private Integer status;

    /**
     * 订单类型：0->正常订单；1->秒杀订单；2->活动订单
     */
    @TableField("order_type")
    private Integer orderType;

    /**
     * 支付卡号
     */
    @TableField("pay_card_no")
    private String payCardNo;

    /**
     * 商品 ID
     */
    @TableField("product_id")
    private Long productId;

    /**
     * 商品名称
     */
    @TableField("product_name")
    private String productName;

    /**
     * 活动 ID
     */
    @TableField("activity_id")
    private Long activityId;

    /**
     * 活动名称
     */
    @TableField("activity_name")
    private String activityName;

    /**
     * 收货人姓名
     */
    @TableField("receiver_name")
    private String receiverName;

    /**
     * 收货人电话
     */
    @TableField("receiver_phone")
    private String receiverPhone;

    /**
     * 省份/直辖市
     */
    @TableField("receiver_province")
    private String receiverProvince;

    /**
     * 城市
     */
    @TableField("receiver_city")
    private String receiverCity;

    /**
     * 区
     */
    @TableField("receiver_region")
    private String receiverRegion;

    /**
     * 详细地址
     */
    @TableField("receiver_detail_address")
    private String receiverDetailAddress;

    /**
     * 订单备注
     */
    @TableField("note")
    private String note;

    /**
     * 确认收货状态：0->未确认；1->已确认
     */
    @TableField("confirm_status")
    private Integer confirmStatus;

    /**
     * 删除状态：0->未删除；1->已删除
     */
    @TableField("delete_status")
    private Integer deleteStatus;

    /**
     * 支付时间
     */
    @TableField("payment_time")
    private Date paymentTime;

    /**
     * 确认收货时间
     */
    @TableField("receive_time")
    private Date receiveTime;

    /**
     * 修改时间
     */
    @TableField("modify_time")
    private Date modifyTime;
}
